//app.js
App({
  onLaunch(e) {
    console.log`onLaucah:${e}`

  },
  globalData: {
    isStudent: true,
    sId: null,
    sImg: "/images/head.png",
    sName: "登录",
    newMessageCount: null,
    myhomework: false,
    classgonggao: false,
    socket: null,
  },
  goToSign
})
/**
 * 跳转签到界面
 */
function goToSign(d) {
  console.log(d)
  wx.showModal({
    title: '签到',
    content: `${d.cName}  正在签到,${d.startTime}  到  ${d.endTime}`,
    confirmText: "确定",
    cancelText: "取消",
    success: function (res) {
      console.log(res);
      if (res.confirm) {
        wx.navigateTo({
          url: `/pages/camera/camera?course=${d.course}&courseTime=${d.courseTime}&latitude=${d.latitude}&longitude=${d.longitude}`,
          success: () => console.log`navgateTo success`,
          fail: () => console.log`navgateTo fail`,
        })
      } else {
        console.log('取消')
      }
    }
  });
}